import {nation_data} from '@/common/js/nation.js'
import age from '@/common/js/age.js'
export default {
    getAge(val) {
        return age.age(age.dateToggle('-','-','',new Date(val)),age.dateToggle('-','-','',new Date()));
    },
    getGender(val) {
        if(val == '1') {
            return '女'
        } else if(val == '2') {
            return '男'
        } else {
            return '保密'
        }
    },
    getDisability_Type(val,data) {
        for (let i = 0; i < data.length; i++) {
            const item = data[i];
            if(val == item.Code_No) {
                return item.Code_Name
            }
        }
        return ''
    },
    getNation(val) {
        for (let i = 0; i < nation_data.length; i++) {
            const item = nation_data[i];
            if(val == item.id) {
                return item.name
            }
        }
        return ''
    },
    getStudyName(val,data) {
        for (let i = 0; i < data.length; i++) {
            if(val == data[i].SID){
                return data[i].SName;
            }
        }
        return '未知'
    },
    getTeacherName(val,data) {
        for (let i = 0; i < data.length; i++) {
            if(val == data[i].TID){
                return data[i].T_Name;
            }
        }
        return '未知'
    }
}